<% if @activities.empty? %>
	
	<% unless params[:responsible] %>
		<% title t(:activity, :count => 0) %>
	
		<div class="alert green center rounded-8 shadow-low">
			<h1><%= link_to t(:new, :scope => :activity), new_project_activity_url(@project) %></h1>
			<p><%= t :has_no_activities, :scope => :activity %></p>
		</div>
	<% else %>
		<div class="alert gray center rounded-8 shadow-low">
			<h1><%= t :user_has_no_activities, :scope => :activity %></h1>
		</div>
	<% end %>
	
<% else %>
	<%= title t(:activity, :count => @activities.size) %>
	
	<%= render "table", :caption => t(:open_activities, :scope => :activity), :activities => @open_activities, :show_responsible => true, :show_milestone => true %>
	
	<%= render "table", :caption => t(:closed_activities, :scope => :activity), :activities => @closed_activities, :show_responsible => true, :show_milestone => true %>
	
	<% content_for :sidebar do %>
		<p class="center"><%= link_to content_tag(:span, t(:create_new, :scope => :activity), :class => "icon add"), new_project_activity_url, :class => "awesome large" %></p>
		
		<p class="title lightest rounded-4"><%= t :filter, :scope => :form %></p>
		<% form_tag project_activities_path(@project), :method => :get, :class => "basic-form rounded" do |form| %>
		
			<dl>
				<dt>
					<small><%= label_tag :responsible, t(:filter_activities_by_responsible, :scope => :activity) %></small>
				</dt>
				<dd>
					<%= select_tag :responsible, 
								   options_for_select([[t(:anyone), '']].concat(@responsibles.collect{|u| [u.to_s + (u.id == current_user.id ? " (#{t(:me)})" : ''), u.id]})) %>
					
					<button type="submit" class="awesome smallest">
						<%= t(:filter, :scope => :form) %>
					</button>
				</dd>
			</dl>
		<% end %>
	<% end %>
<% end %>

<% content_for :subtabs do %>
	<%= render "activities/navigation/index_subtabs" %>
<% end %>